

(function($) {
	$.fn.validationEngineLanguage = function() {};
	$.validationEngineLanguage = {
		newLang: function() {
			$.validationEngineLanguage.allRules = 	{"required":{    			// Add your regex rules here, you can take telephone as an example
						"regex":"none",
						"alertText":"* 该项为必填项",
						"alertTextCheckboxMultiple":"* 请选择",
						"alertTextCheckboxe":"* 请选择"},
					"length":{
						"regex":"none",
						"alertText":"*您输入的字符长度不正确，请确保长度在 ",
						"alertText2":" 和 ",
						"alertText3": " 之间"},
					"maxCheckbox":{
						"regex":"none",
						"alertText":"* 您选取的选项过多，请重新选择"},	
					"minCheckbox":{
						"regex":"none",
						"alertText":"* 您选取的选项过少,至少选择 ",
						"alertText2":" 项"},
					"numBetween":{
						"nname":"numBetween",
						"alertText":"* 您输入的值必须介于0~100之间"
					},
					"confirm":{
						"regex":"none",
						"alertText":"* 您两次填写的内容不完全一致，请重新填写"},	
//从telephone往下，除了validate2fields，都需要写成如：custom[telephone]的样式
//custom与funcCall的差别在于，custom是使用正则表达式进行验证即可，而funcCall需要写js函数来进行验证。				
					"email":{
						"regex":"/^[a-zA-Z0-9_\.\-]+\@([a-zA-Z0-9\-]+\.)+[a-zA-Z0-9]{2,4}$/",
						"alertText":"* 无效的邮件地址，请重新填写"},	
					"date":{
                         "regex":"/^[0-9]{4}\-\[0-9]{1,2}\-\[0-9]{1,2}$/",
                         "alertText":"* 日期格式错误，请按照 2012-12-21 这样的格式填写"},
					"onlyNumber":{
						"regex":"/^[0-9\ ]+$/",
						"alertText":"* 只能输入数字"},	
					"postCode":{
						"regex":"/^[0-9]{6}$/",
						"alertText":"* 无效的邮编，请重新填写"},	
					"onlyDouble":{
						"regex":"/^[0-9\ ]+([.][0-9\ ]+)?$/",
						"alertText":"* 只能输入数字"},
					"onlyDoubleTwo":{
						"regex":"/^[0-9\ ]+([.][0-9\ ]{2})?$/",
						"alertText":"* 请精确到小数点后2位有效数字"},
					"onlyTelephone":{
						"regex":"/^([0-9]{3}-[0-9]{8})|([0-9]{4}-[0-9]{7})|([0-9]{7})|([0-9]{8})|[0-9]{11}$/",
						"alertText":"* 无效的电话号码，请重新填写"},
					"noSpecialCaracters":{
						"regex":"/^[0-9a-zA-Z]+$/",
						"alertText":"* 该项只接受数字和字母的输入"},	
					"ajaxUser":{
						"postfile":"user_isexisted",
						"extraData":"&ajax=true&jqvalidate=true",
						"alertTextOk":"* 恭喜，用户名可用",	
						"alertTextLoad":"* 正在验证，请等待",
						"alertText":"* 该用户名已被占用，请换个名字试试",
						"processing": function(){
							$("input[type=submit]").attr("disabled","true");
						},
						"succeed":function(){
							$("input[type=submit]").removeAttr("disabled");
						}},	
					"ajaxCorporateCode":{
						"postfile":"corporate_code_existed",
						"extraData":"&ajax=true&jqvalidate=true",
						"alertTextOk":"* 该法人代码可用",	
						"alertTextLoad":"* 正在验证,请等待",
						"alertText":"* 该法人代码的所在企业用户已经存在,请输入正确法人代码",
						"processing": function(){
							$("input[type=submit]").attr("disabled","true");
						},
						"succeed":function(){
							$("input[type=submit]").removeAttr("disabled");
						}},		
					"ajaxVerifyCode":{
						"postfile":"check_verify_code",
						"extraData":"&ajax=true&jqvalidate=true",
						"alertTextOk":"* 检测通过",	
						"alertTextLoad":"* 正在检测验证码，请等待",
						"alertText":"* 验证码填写错误",
						"processing": function(){
							$("input[type=submit]").attr("disabled","true");
						},
						"succeed":function(){
							$("input[type=submit]").removeAttr("disabled");
						}},	
					"ajaxName":{
						"postfile":"validateUser.php",
						"alertText":"* 该用户名已被占用，请换个名字试试",	
						"alertTextOk":"* 恭喜，用户名可用",	
						"alertTextLoad":"* 正在验证，请等待"},		
					"onlyLetter":{
						"regex":"/^[a-zA-Z\ \']+$/",
						"alertText":"* 只能输入字母"},
					"validate2fields":{
    					"nname":"validate2fields",
    					"alertText":"* You must have a firstname and a lastname"}	
					}	
					
		}
	}
})(jQuery);

$(document).ready(function() {	
	$.validationEngineLanguage.newLang()
});